package nc.bs.pub.action;

import nc.bs.common.projectFAUtils;
import nc.bs.framework.common.NCLocator;
import nc.bs.pub.compiler.AbstractCompiler2;
import nc.itf.pu.m25.IInvoiceApprove;
import nc.vo.pu.m25.entity.InvoiceVO;
import nc.vo.pub.BusinessException;
import nc.vo.pub.compiler.PfParameterVO;
import nc.vo.uap.pf.PFBusinessException;

public class N_25_UNAPPROVE extends AbstractCompiler2 {
	public Object runComClass(PfParameterVO vo) throws BusinessException {
		try {
			super.m_tmpVo = vo;
			InvoiceVO[] vos = (InvoiceVO[]) ((InvoiceVO[]) this.getVos());
			InvoiceVO[] retValue = new InvoiceVO[vos.length];

			//lhw 231128保存前校验项目 begin
			new projectFAUtils().projectDataApprove("po_invoice", vos, "unsave");
			//end
			
			for (int i = 0; i < vos.length; ++i) {
				InvoiceVO invVo = vos[i];
				this.setVo(invVo);
				InvoiceVO[] retInvVos = ((IInvoiceApprove) NCLocator.getInstance().lookup(IInvoiceApprove.class))
						.unapprove(new InvoiceVO[]{invVo}, this);
				retValue[i] = retInvVos[0];
			}

			return retValue;
		} catch (Exception var7) {
			if (var7 instanceof BusinessException) {
				throw (BusinessException) var7;
			} else {
				throw new PFBusinessException(var7.getMessage(), var7);
			}
		}
	}
}